/**
 * Created by Admin on 2018/1/3.
 */
define(function (require, exports, module) {
    require("../common/dialog.js");
    var myWidGet = require("../common/myWidGet.js");
    $(function () {
        // $("#yearFeeExpiredMonths").val(1);
        $.ajax({
            url: window.jkconfig.webapiurlv + "sys/timeranges",
            type: 'GET',
            success: function (data) {
                if (data.code == 0) {
                    $("#yearFeeExpiredMonths").val(data.yearFeeExpiredMonths);
                    $("#expiredMonths").val(data.expiredMonths);
                    $("#patent-month").html(data.expiredMonths);
                    // localStorage["expiredMonths"] = data.expiredMonths;
                } else {
                    $.showErr("获取失败!");
                }
            }
        })

        $("body").on("click",".btnSave",function(){
            $.ajax({
                type:"post",
                url:window.jkconfig.webapiurlv+"sys/timeranges",
                data:$("#timeRange").serialize(),
                success:function(data){
                    if(data.code == 0){
                        $.showSuccessTimeout(data.msg);
                    }else{
                        $.showErr(data.msg);
                    }
                }
            })
        })
    })
})